package cn.example.demo.modules.house.entity;

import cn.example.demo.common.db.pojo.entity.BaseEntity;
import cn.example.demo.common.tools.obj.reflect.FieldAlias;
import cn.example.demo.common.tools.obj.reflect.Immutable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.FieldNameConstants;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 描述：【房源】实体类
 */
@FieldNameConstants
@Data
@AllArgsConstructor
@NoArgsConstructor
public class House extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @Immutable
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @FieldAlias("ID")
    private String id;

    @FieldAlias("房间标题")
    private String houseTitle;

    @FieldAlias("地区")
    private String regionId;

    @FieldAlias("具体位置")
    private String detailLocation;

    @FieldAlias("房源类型")
    private String houseType;

    @FieldAlias("配套服务设施")
    private String provide;

    @FieldAlias("房间详情")
    private String detail;

    @FieldAlias("单价/天")
    private BigDecimal cost;

    @FieldAlias("折扣")
    private BigDecimal discount = BigDecimal.ONE;   // 默认 1

    @FieldAlias("入住要求")
    private String command;

    @FieldAlias("房源状态")
    private Integer houseStatus;

    @FieldAlias("房源数量")
    private Integer inventory = 0;

    @FieldAlias("已预定")
    private Integer ordering = 0;

    @TableField(exist = false)
    @FieldAlias("封面图")
    private String cover;

    @TableField(exist = false)
    @FieldAlias("房间图列表")
    private List<String> houseImagesUrl;
}
